package AddonsSheepContoller.Utils;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin;

public class LanguageManager {
    private FileConfiguration languageIndex;
    private final Plugin resourcePlugin;
    private final String languageResourceAddress;
    private final String usingLanguageCode;

    public LanguageManager(Plugin resourcePlugin, String languageResourceAddress, String usingLanguageCode) {
        this.resourcePlugin = resourcePlugin;
        this.languageResourceAddress = languageResourceAddress;
        this.usingLanguageCode = usingLanguageCode;
    }

    public boolean loadIndex(String languageIndexAddress) {
          YamlLoader indexLoader = new YamlLoader(this.resourcePlugin); indexLoader.setCustomYaml(false, languageIndexAddress);
          if(indexLoader.getYamlIO() == null) return false;
          else this.languageIndex = indexLoader.getYamlIO();

          return true;
    }

    public boolean loadLanguages() {
        String[] languagesAddress = (String[])this.languageIndex.getStringList("languageDocuments").toArray();
    }
}
